<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>企业登录--数据上报系统</title>
		<link rel="stylesheet" href="/report/Public/Home/css/login.css" />
		<script type="text/javascript" src="/report/Public/Home/js/jquery.min.js"></script>
		<script src="/report/Public/assets/js/jquery.form.js"></script>
		<script src="/report/Public/layer/layer.js"></script>
	</head>

	<body>
		<div class="top">
			<img src="/report/Public/Home/img/name.png" id="name" />
		</div>
		<div class="center">
			
		</div>
		<div class="bottom">
			<div class="gs">
				版权所有&copy;2017 成都网道科技有限公司
			</div>
		</div>
		<img src="/report/Public/Home/img/img.png" id="showImg" />
		<form method="post" action="<?php echo U('check_login');?>" name="form0" id="form0">
			<div id="login">
				<div class="qy">企业登录</div>
				<div class="input">
					<input type="text" name="userInfo" id="userInfo" placeholder="请输入账号" value="" />
					<input type="password" name="userPsd" id="userPsd" placeholder="请输入密码" value="" />
				</div>
				<div class="choose">
					<label for=""><input type="checkbox" name="" id="" value="" />记住我的密码</label>
					<!--<div class="getPsd">忘记密码？</div>-->
				</div>
				<!--<div><button class="loginBtn">登录</button></div>-->
				<div id="first" class="div-css3">
					<div class="top"></div>
					<div class="right"></div>
					<div class="bottom"></div>
					<div class="left"></div>
					<div class="p-text">登录</div>
				</div>
			</div>
		</form>

	</body>

<script>
	var app = "/report/index.php";
	$(function () {
		$('.p-text').click(function () {
			var userInfo = $('#userInfo').val();
			var userPsd = $('#userPsd').val();
			if ('' == userInfo){
				layer.alert('请填写登录账号', {icon: 5}, function(index){
					layer.close(index);
					$('#userInfo').focus();
				});
				return false;
			}
			if ('' == userPsd){
				layer.alert('请输入登录密码', {icon: 5}, function(index){
					layer.close(index);
					$('#userPsd').focus();
				});
				return false;
			}
			
			$.ajax({
				type : 'post',
				url : app+'/Home/login/checklogin',
				data : {userInfo:userInfo,userPsd:userPsd},
				dataType : 'json',
				success: function (data) {

					console.log(data);
					if ( data.state == false){
						layer.alert(data.message, {icon: 5}, function(index){
							layer.close(index);
						});
						return false;
					}else{
						layer.alert(data.message, {icon:6}, function(index){
							layer.close(window.location.href=app+"/Home/index/index");
						});
						return false;
					}
				}
			});
		});

	})
</script>

</html>